package net.dgg.rz.production.entity.dto;

import net.dgg.rz.production.entity.ProductOrder;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by zyou on 2018/12/17.
 */
public class ProductOrderDto extends ProductOrder {
    private String receiveTimeStatus;//接收超期状态
    private String orderTimeStatus;//订单超期状态
    private String distributionTimeOutStatus;//分配超期
    private String nodeTimeStatus;//节点超期状态
    private String assistUserName;//协单人员名字
    private String wayOfLoanName;//还款方式中文
    private String rateTypeName;//利率方式中文
    private Date orderEndTime;//订单截止时间
    private String purposeStr; // 资金用途code(1消费2经营)
    private String statusCode;//状态码
    private String loanMoneyStr;//放款金额
    private String loanTimeStr;//放款时间
    private String dateOfLoanStr;//每月还款日期
    private String repaymentDateStr;//还款到期时间

    public String getRateTypeName() {
        return rateTypeName;
    }

    public void setRateTypeName(String rateTypeName) {
        this.rateTypeName = rateTypeName;
    }

    public Date getOrderEndTime() {
        return orderEndTime;
    }

    public void setOrderEndTime(Date orderEndTime) {
        this.orderEndTime = orderEndTime;
    }

    public String getWayOfLoanName() {
        return wayOfLoanName;
    }

    public void setWayOfLoanName(String wayOfLoanName) {
        this.wayOfLoanName = wayOfLoanName;
    }

    public String getReceiveTimeStatus() {
        return receiveTimeStatus;
    }

    public void setReceiveTimeStatus(String receiveTimeStatus) {
        this.receiveTimeStatus = receiveTimeStatus;
    }

    public String getOrderTimeStatus() {
        return orderTimeStatus;
    }

    public void setOrderTimeStatus(String orderTimeStatus) {
        this.orderTimeStatus = orderTimeStatus;
    }

    public String getAssistUserName() {
        return assistUserName;
    }

    public void setAssistUserName(String assistUserName) {
        this.assistUserName = assistUserName;
    }

    public String getNodeTimeStatus() {
        return nodeTimeStatus;
    }

    public void setNodeTimeStatus(String nodeTimeStatus) {
        this.nodeTimeStatus = nodeTimeStatus;
    }    public String getDistributionTimeOutStatus() {
        return distributionTimeOutStatus;
    }

    public void setDistributionTimeOutStatus(String distributionTimeOutStatus) {
        this.distributionTimeOutStatus = distributionTimeOutStatus;
    }

    public String getPurposeStr() {
        if(this.getPurpose()!= null && this.getPurpose()==1){
            this.purposeStr = "消费";
        }
        if(this.getPurpose()!= null && this.getPurpose()==2){
            this.purposeStr = "经营";
        }
        return purposeStr;
    }

    public void setPurposeStr(String purposeStr) {
        this.purposeStr = purposeStr;
    }

    public String getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(String statusCode) {
        this.statusCode = statusCode;
    }

    public String getLoanMoneyStr() {
        this.loanMoneyStr = this.getLoanMoney()==null?"":this.getLoanMoney().toString();
        return loanMoneyStr;
    }

    public String getLoanTimeStr() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        this.loanTimeStr = this.getLoanTime()==null?"":simpleDateFormat.format(this.getLoanTime());
        return loanTimeStr;
    }

    public String getDateOfLoanStr() {
        this.dateOfLoanStr = this.getDateOfLoan()==null?"":"每月"+this.getDateOfLoan()+"号";
        return dateOfLoanStr;
    }

    public String getRepaymentDateStr() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        this.repaymentDateStr = this.getRepaymentDate()==null?"":simpleDateFormat.format(this.getRepaymentDate());
        return repaymentDateStr;
    }

    @Override
    public String toString() {
        return "ProductOrderDto{" +
                "receiveTimeStatus='" + receiveTimeStatus + '\'' +
                ", orderTimeStatus='" + orderTimeStatus + '\'' +
                ", distributionTimeOutStatus='" + distributionTimeOutStatus + '\'' +
                ", nodeTimeStatus='" + nodeTimeStatus + '\'' +
                ", assistUserName='" + assistUserName + '\'' +
                ", wayOfLoanName='" + wayOfLoanName + '\'' +
                ", rateTypeName='" + rateTypeName + '\'' +
                ", orderEndTime=" + orderEndTime +
                ", purposeStr='" + purposeStr + '\'' +
                '}';
    }
}
